<template>
	<layout :loading="loading" :curPage="'compareCheck'+ (conditions['tcc.type'] ? conditions['tcc.type'] : '')" title="比对校验结果">
		
		
		<conditions :list="conditonList" :conditions="conditions" @submit="submitSearch"></conditions>

		<div class="layui-form layui-border-box layui-table-view">

			<tableList :list="page.list" :canSelect="false">

				<block slot="head">
					<th>检测时间</th>
					<th>类型</th>
					<th>项目</th>
					<th>单位</th>
					<th>比对检测数据</th>
					<th>在线监测数据</th>
					<th>误差</th>
					<th>标准限值</th>
					<th>比对结果</th>
					<th>检测机构</th>
					<th>检测报告号</th>
					<th>点位名称</th>
					<th>企业名称</th>
					<th class="autoWidth">运维公司</th>
					<th>记录人</th>
				</block>

				<block slot="body">

					<tr v-for="( x , index) in page.list" :key="index">
						<td>
							{{x.createTime}}
						</td>
						<td>
							{{x.typeStr}}
						</td>
						<td>
							{{x.name}}
						</td>
						<td>
							{{x.unit}}
						</td>
						<td>
							{{x.compareData}}
						</td>
						<td>
							{{x.onlineData}}
						</td>
						<td>
							{{x.error}}%
						</td>
						<td>
							{{x.standard}}
						</td>
						<td>
							{{x.result}}
						</td>
						<td>
							{{x.testing}}
						</td>
						<td>
							{{x.testingId}}
						</td>
						<td>
							{{x.stationName}}
						</td>
						<td>
							{{x.companyName1}}
						</td>
						<td>
							{{x.servicerName2}}
						</td>
						<td>
							{{x.recorder}}
						</td>
					</tr>

				</block>

			</tableList>
			
			<emptyTips :loading="loading" :list="page.list"></emptyTips>

			<paginate :page="page" @switchPage="switchPage" @changePageSize="changePageSize"></paginate>
			
		</div>


	</layout>
</template>

<script>
	export default {
		data() {
			return {
				conditonList:[
					{title:"创建时间",name:"tcc.createTime.start",endName:"tcc.createTime.end",type:"date"},
					{title:"项目",name:"tcc.name",type:"varchar"},
					{title:"检测报告号",name:"tcc.testingId",type:"varchar"}
				],
				conditions: {},
				loading: true ,
				action: "/admin/compareCheck/list",
				page: {
					pageNumber: 1,
					lastPage: true,
					totalPage: 1,
					list: [],
					totalRow: 0,
					pageSize: 10
				}
			}
		},
		
		onLoad:function(res){
			this.conditions = res || {} ;
		},

		onShow() {
			this.kit.getPage(this.action,function(res){
			});
		},

		methods: {
			submitSearch:function(conditions){
				this.conditions = conditions ;
				this.switchPage(1);
			},
			
			switchPage: function(pageNumber) {
				this.page.pageNumber = pageNumber || this.page.pageNumber ;
				this.kit.getPage(this.action);
			},
			
			changePageSize: function(pageSize) {
				this.page.pageSize = pageSize;
				this.page.pageNumber = 1;
				this.kit.getPage(this.action);
			},
		}
	}
</script>